package app.server.project.main.service.dto.race;

import app.server.project.main.service.db.entity.cfg.RaceCfgEntity;
import app.server.project.main.service.db.entity.user.UserInfoEntity;
import cn.hutool.core.bean.BeanUtil;
import lombok.Data;

@Data
public class AiCoinDto {
    private long aiCoin;
    private int rate;
    private int cfgId;

    public static AiCoinDto of(UserInfoEntity userInfoEntity, RaceCfgEntity raceCfgEntity) {
        AiCoinDto dto = new AiCoinDto();
        BeanUtil.copyProperties(userInfoEntity, dto, true);
        BeanUtil.copyProperties(raceCfgEntity, dto, true);
        dto.setCfgId(raceCfgEntity.getId());
        return dto;
    }
}
